<template>
  <div style="height: 800px; padding-bottom: 17px">
    <el-card class="box-card-test2">
      <div slot="header" class="clearfix">
        <span style="font-size: 20px">测试结果表</span>
      </div>
      <div
        style="
          height: 740px;
          overflow: auto;
          overflow-x: hidden;
          font-size: 20px;
        "
      >
        <ul v-for="(value, key, index) in testResultList" :key="index">
          <li>ID：{{ key }}</li>
          <li style="white-space: pre-wrap">结果：{{ value }}</li>
          <br />
        </ul>
      </div>
    </el-card>
  </div>
</template>

<script>
import { mapState, mapActions } from "vuex";

export default {
  data() {
    return {};
  },
  mounted() {
    this.getTestResultList();

    //每隔1s进行更新
    window.setInterval(() => {
      setTimeout(this.getTestResultList(), 0);
    }, 1000);
  },
  computed: {
    ...mapState(["testResultList"]),
  },
  methods: {
    ...mapActions(["queryTestResultList"]),
    getTestResultList() {
      this.queryTestResultList();
    },
  },
};
</script>

<style lang="less">
// @table-background-color: #0a4271 !important;

.box-card-test2 {
  width: 95%;
  margin-left: 2%;
  margin-bottom: 2%;
  /* height: auto !important; */
  height: 800px !important;
  min-height: 800px !important;
}
</style>
